<?php

use think\migration\Migrator;
use think\migration\db\Column;

class CreateUserTable extends Migrator
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
	{
	  $this->table('user')
	    ->addColumn(Column::string('name')->setComment('用户昵称'))
	    ->addColumn(Column::string('username')->setUnique()->setComment('用户名'))
	    ->addColumn(Column::string('email')->setUnique()->setComment('邮箱'))
	    ->addColumn(Column::string('password')->setComment('密码'))
	    ->addColumn(Column::integer('inputtime','11')->setComment('时间'))
	    ->addColumn(Column::date('create_time')->setComment('时间1'))
	    ->addColumn(Column::dateTime('update_time')->setComment('时间2'))
	    ->create();
	}
	
	/**
	* Down Method.
	*/
	public function down()
	{
		$this->dropTable('user');
	}
    
}
